package repository

import (
	"shop/src/model"
	"xorm.io/xorm"
)

type DocumentRepository struct {
	engine *xorm.Engine
}

func NewDocumentRepository(engine *xorm.Engine) *DocumentRepository {
	return &DocumentRepository{engine: engine}
}

func (r *DocumentRepository) Insert(docs []model.Document) error {
	_, err := r.engine.Insert(docs)
	if err != nil {
		return err
	}
	return nil
}
